package com.yinhai.asynctask;

import java.util.List;
import java.util.Map;

import org.jivesoftware.smack.XMPPConnection;
import org.json.JSONObject;

import android.content.Context;
import android.widget.Toast;

import com.yinhai.activity.ChatAddGroupActivity;

public class AddModifyGroupTask extends AsyncTaskForHttpProcess {
	String retStr = null;
	private Context context;
	private String groupName;
	ChatAddGroupActivity groupActivity;
	private List<String> phoneList = null;
	private List<String> delPhoneList = null;
	private String createUserPhone;
	private String groupId;

	public AddModifyGroupTask(Context context,
			ChatAddGroupActivity groupActivity, String groupName,
			List<String> phoneList, List<String> delPhoneList,
			String createUserPhone, String groupId) {
		super(context, false);
		this.context = context;
		this.groupName = groupName;
		this.groupActivity = groupActivity;
		this.phoneList = phoneList;
		this.delPhoneList = delPhoneList;
		this.createUserPhone = createUserPhone;
		this.groupId = groupId;
	}

	public AddModifyGroupTask(Context context, boolean autoForword) {
		super(context, autoForword);
	}

	public AddModifyGroupTask(Context context, int timeoutRequestCount,
			boolean autoForword) {
		super(context, timeoutRequestCount, autoForword);
	}

	@Override
	protected void parse(Map<String, Object> result) {
		this.retStr = (String) result.get(AsyncTaskContext.RESPONSE_CONTENT);
		JSONObject jo;
		XMPPConnection connection = null;
		try {
			jo = new JSONObject(retStr);
			if ("0".equals(jo.getString("status"))) {

			} else {
				Toast.makeText(context, "服务器错误", Toast.LENGTH_SHORT).show();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}
